using System.Collections.Generic;
using Holoville.HOTween;
using Holoville.HOTween.Core;
using UnityEngine;

public class butCustomGame : MonoBehaviour
{
	[SerializeField]
	private UISprite indicationSprite;

	[SerializeField]
	private UILabel indicationLabel;

	private void OnClick()
	{
		if (Load.LoadBool(settings.KeyActionAfterTutor))
		{
			Dictionary<string, string> dictionary = new Dictionary<string, string>();
			dictionary.Add("Action after tutor", "PVP");
			FlurryWrapper.LogEvent(FlurryWrapper.EV_TUTORIAL_CLOSE, dictionary);
			Save.SaveBool(settings.KeyActionAfterTutor, false);
		}
		settings.playSoundButton();
		controllerMenu.thisScript.ClickOnButton = true;
		controllerMenu.thisScript.showWindowPVP();
		FlurryWrapper.LogEvent(FlurryWrapper.EV_LAUNCH_ONLINE);
	}

	private void OnEnable()
	{
		ShowIndicator(false);
	}

	private void ShowIndicator(bool val, int eventCount = 0)
	{
		HOTween.Kill(this);
		if (val)
		{
			if (indicationSprite != null)
			{
				indicationSprite.transform.localScale = Vector3.one * 0.3f;
				HOTween.To(indicationSprite.transform, 0.3f, new TweenParms().Prop("localScale", Vector3.one * 1.2f).OnComplete((TweenDelegate.TweenCallback)delegate
				{
					HOTween.To(indicationSprite.transform, 0.2f, new TweenParms().Prop("localScale", Vector3.one).OnComplete((TweenDelegate.TweenCallback)delegate
					{
					}));
				}));
			}
			if (indicationLabel != null)
			{
				HOTween.To(indicationLabel.transform, 0.5f, new TweenParms().Prop("localScale", Vector3.one));
				indicationLabel.text = eventCount.ToString();
			}
		}
		else
		{
			if (indicationSprite != null)
			{
				indicationSprite.transform.localScale = Vector3.zero;
			}
			if (indicationLabel != null)
			{
				indicationLabel.transform.localScale = Vector3.zero;
			}
		}
	}
}
